home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / control.mrbk < prev    next >
Text File  |  1996-09-26  |  1KB  |  56 lines

  1. /* control.mrbk */
  2.  
  3. /* This ARexx script exercises the takecontrol/releasecontrol keywords. */
  4.  
  5. signal on ERROR
  6. signal on BREAK_C
  7.  
  8. parse source type res called resolved ext host
  9.  
  10. options results
  11.  
  12. if ~(Show('P', 'MRBackup_#1')) then do
  13.     say "You must run MRBackup first. With a little work, you could"
  14.     say "get this ARexx script to do it for you."
  15.     exit 1
  16. end
  17.  
  18. address "MRBackup_#1"
  19.  
  20. /* poptofront */
  21.  
  22. takecontrol
  23. if rc ~= 0 then do
  24.     say "I failed to take control of MRBackup; rc = " || rc
  25.     exit rc
  26. end
  27.  
  28. say "Try to interact with MRBackup's window. You shouldn't be able to."
  29. say "Type anything when you are done."
  30.  
  31. pull response
  32.  
  33. releasecontrol
  34.  
  35. say "I have given control back to MRBackup. It should now behave normally."
  36.  
  37. exit 0
  38.  
  39.  
  40. /*------------------------------------------------------------------*/
  41.  
  42. break_c:
  43.  
  44. say "*** Control-C recieved.  Stopped by user. ***"
  45. exit 5
  46.  
  47. /*------------------------------------------------------------------*/
  48.  
  49. error:
  50.  
  51. say "Error"
  52. exit 6
  53.  
  54. /*------------------------------------------------------------------*/
  55.  
  56.